package com.mnc.entity;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
@Entity
public class PageNote implements Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = -980912773816121786L;
	
	//主键id
	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	private int noteId;
	//留言内容
	@Column
	private String noteContent;
	//留言时间
	@Column
	private Date noteDate;
	//是否可见
	@Column
	private boolean noteView=true;
	//关联空间
	@ManyToOne(cascade= {CascadeType.REFRESH},fetch=FetchType.LAZY)
	private UserPage onPage;
	//留言人
	@ManyToOne(cascade= {CascadeType.REFRESH})
	private User byUser;
	
	
	public int getNoteId() {
		return noteId;
	}
	public void setNoteId(int noteId) {
		this.noteId = noteId;
	}
	public String getNoteContent() {
		return noteContent;
	}
	public void setNoteContent(String noteContent) {
		this.noteContent = noteContent;
	}
	public Date getNoteDate() {
		return noteDate;
	}
	public void setNoteDate(Date noteDate) {
		this.noteDate = noteDate;
	}
	public UserPage getOnPage() {
		return onPage;
	}
	public void setOnPage(UserPage onPage) {
		this.onPage = onPage;
	}
	public User getByUser() {
		return byUser;
	}
	public void setByUser(User byUser) {
		this.byUser = byUser;
	}
	public boolean isNoteView() {
		return noteView;
	}
	public void setNoteView(boolean noteView) {
		this.noteView = noteView;
	}
	
	
}
